package com.ruoyi.process.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.process.mapper.WorkGraftingMapper;
import com.ruoyi.process.domain.WorkGrafting;
import com.ruoyi.process.service.IWorkGraftingService;

/**
 * 嫁接管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class WorkGraftingServiceImpl implements IWorkGraftingService 
{
    @Autowired
    private WorkGraftingMapper workGraftingMapper;

    /**
     * 查询嫁接管理
     * 
     * @param workGraftingId 嫁接管理ID
     * @return 嫁接管理
     */
    @Override
    public WorkGrafting selectWorkGraftingById(Long workGraftingId)
    {
        return workGraftingMapper.selectWorkGraftingById(workGraftingId);
    }

    /**
     * 查询嫁接管理列表
     * 
     * @param workGrafting 嫁接管理
     * @return 嫁接管理
     */
    @Override
    public List<WorkGrafting> selectWorkGraftingList(WorkGrafting workGrafting)
    {
        return workGraftingMapper.selectWorkGraftingList(workGrafting);
    }

    /**
     * 新增嫁接管理
     * 
     * @param workGrafting 嫁接管理
     * @return 结果
     */
    @Override
    public int insertWorkGrafting(WorkGrafting workGrafting)
    {
        workGrafting.setCreateTime(DateUtils.getNowDate());
        return workGraftingMapper.insertWorkGrafting(workGrafting);
    }

    /**
     * 修改嫁接管理
     * 
     * @param workGrafting 嫁接管理
     * @return 结果
     */
    @Override
    public int updateWorkGrafting(WorkGrafting workGrafting)
    {
        workGrafting.setUpdateTime(DateUtils.getNowDate());
        return workGraftingMapper.updateWorkGrafting(workGrafting);
    }

    /**
     * 批量删除嫁接管理
     * 
     * @param workGraftingIds 需要删除的嫁接管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkGraftingByIds(Long[] workGraftingIds)
    {
        return workGraftingMapper.deleteWorkGraftingByIds(workGraftingIds);
    }

    /**
     * 删除嫁接管理信息
     * 
     * @param workGraftingId 嫁接管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkGraftingById(Long workGraftingId)
    {
        return workGraftingMapper.deleteWorkGraftingById(workGraftingId);
    }
}
